package com.zyt.mall.order;

import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 * 使用RabbitMQ
 * 1.引入RabbitMQ依赖RabbitAutoconfiguration
 * 2.给容器中自动配置了
 *       RabbitTemplate、AmqpAdmin、CachingConnectionFactory、RabbitMessagingTemplate
 *       所有属性都是spring.rabbitmq
 *       @ConfigurationProperties(prefix = "spring.rabbitmq")
 *       public class RabbitProperties
 *
 * 3.给配置文件中配置spring.rabbitmq信息
 * 4.@EnableRabbit开启RabbitMQ模式
 */
@EnableAspectJAutoProxy(exposeProxy = true)
@EnableRabbit
@EnableRedisHttpSession
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
public class OrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class, args);
    }

}
